<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>冻结管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
<body layadmin-themealias="default" style="">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item" style="height: 20px;line-height: 20px;">
                <div class="layui-inline" style="margin-right: 0px;">
                     <span class="layui-breadcrumb">
                        <a href="">首页/冻结管理</a>
                        </span>
                </div>
                <div class="layui-inline" style="right: 0px;position: absolute;">
                    <a class="layui-btn layui-btn-small" style="line-height:20px;margin-top:-6px;float:right" href="javascript:location.replace(location.href);" title="刷新">
                        &nbsp;<i class="layui-icon layui-icon-refresh-3" style="line-height:18px;left: 12px;top:12px;"></i>&nbsp;
                    </a>
                </div>
            </div>
        </div>
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline" style="margin-right: 0px;">
                    <label class="layui-form-label">ID</label>
                    <div class="layui-input-inline">
                        <input type="number" name="gameid"  placeholder="游戏ID/用户ID"  class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <input type="number" placeholder="手机号" name="phonenum"  class="layui-input" >
                    </div>
                </div>
                <div class="layui-inline" style="margin-right: 0px;">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit="" lay-filter="LAY-user-back-search">
                        搜索
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <table class="layui-table" lay-filter="admin_table" id="admin_table"></table>

            <script type="text/html" id="table-nickname">
                <a  style="font-size: 28px; border: none;" lay-event="free">
                  <i class='layui-icon layui-icon-password' style="color: red; font-size: 28px;"></i>
                </a>
            </script>

            <script type="text/html" id="table-useradmin-admin">
                <a class="layui-btn layui-bg-orange layui-btn-sm"  lay-event="recharge">添加冻结</a>
                <a class="layui-btn layui-btn-normal layui-btn-sm"  lay-event="info">添加冻结IP</a>
            </script>
        </div>
    </div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script>
    function openWin(gameid,url) {
        layer.open({
            type: 2,
            title: '信息详情',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: '/member/'+url+'?gameid='+gameid //iframe的url
        });
    }
    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function(){
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        $(".layuiadmin-btn-admin").on("click",function(){
            var gameid = $("input[name=gameid]").val();
            var phonenum = $("input[name=phonenum]").val();


            table.reload('admin_table',{
                page:{
                    curr:1
                }
                ,where:{gameid:gameid,phonenum:phonenum}
            });
        });


        table.render({
            elem: '#admin_table'
            ,url: '/Freeze/getlist' //数据接口
            ,title: '游戏详情'
            ,toolbar: '#table-useradmin-admin'
            ,loading:true
            ,page: true //开启分页
            ,cols: [[ //表头
                { width:160,align:'center',toolbar: '#table-nickname'}
                ,{field: 'phonenum', align:'center', title: '手机号', width:200}
                ,{field: 'gameid', title: '游戏ID', width:160}
                ,{field: 'nikename', title: '会员昵称', width:200}
                ,{field: 'datetime', title: '冻结时间'}
                ,{field: 'content', title: '备注'}
                ,{field: 'operator', title: '操作人'}

            ]]
            ,done:function (res) {
                if(res.message!=''){
                    layer.msg(res.message);
                }
            }
        });

        //监听行工具事件
        table.on('tool(admin_table)', function(obj){
            var data = obj.data;
            var id =data.gameid;
            if(obj.event === 'free'){
                // alert(1);
                layer.msg('正在发送解冻请求，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        $.ajax({
                            type:"GET",
                            datatype:"json",
                            url:'/Freeze/nofree?id='+ id+'&type=8',
                            success:function (data) {
                                console.log(data);
                                if(data['code'] == 0){
                                    layer.msg(data['msg'],{icon: 5});
                                }else{
                                    layer.msg(data['msg'],{icon: 1,time:1000,end:function () {
                                            layui.table.reload("admin_table");
                                    }});
                                }

                            },
                            error:function () {
                                layer.msg("发错错误",{icon: 5})
                            }
                        });
                    }});
            }
        });
        //监听行工具事件
        table.on('toolbar(admin_table)', function(obj){
            var data = obj.data;
            //console.log(obj)
            if(obj.event === 'recharge'){
               // var id = '';
              //  id = obj.data.gameid;
                layer.msg('正在加载，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        layer.open({
                            type: 2,
                            title: '查询冻结玩家',
                            shadeClose: true,
                            shade: 0.8,
                            maxmin: true,
                            area: ['1400px', '80%'],
                            content: '/freeze/searchOne?type=add' //iframe的url
                        });
                    }});


            } else if(obj.event === 'info'){
               // var id = '';
               // id = obj.data.gameid;
                layer.msg('正在加载，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        layer.open({
                            type: 2,
                            title: '冻结IP地址',
                            shadeClose: true,
                            shade: 0.8,
                            maxmin: true,
                            area: ['1400px', '80%'],
                            content: '/freeze/getip' //iframe的url
                        });
                }});
            }else if(obj.event === 'sss'){
                alert(1);
            }
        });
    });
</script>
</body>
</html>






















<!--
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>冻结管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="{$Think.const.RESOURCE}img/favicon.ico">
    <link href="{$Think.const.RESOURCE}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/animate.css" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/font.css">
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/xadmin.css">
      <script type="text/javascript" src="__PUBLIC__/home/js/jquery-3.2.1.min.js"></script>
    &lt;!&ndash;<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>&ndash;&gt;
    <script type="text/javascript" src="{$Think.const.RESOURCE}lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/xadmin.js"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/bootstrap-paginator.js"></script>
    

  </head>
  
  <body class="layui-anim layui-anim-fadein">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页/冻结管理</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:39px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" action="{:U('freeze/index')}" method="post">
          <input type="number" name="gameid"  placeholder="游戏ID" value="{$condi.gameid}"  class="layui-input">
          <input type="number" value="{$condi.phonenum}" placeholder=" 手机号" name="phonenum"  class="layui-input"  style="width:200px;">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>


      </div>
       <xblock>
        <button class="layui-btn layui-btn-danger" onclick="openWinAdd()"><i class="layui-icon"></i>添加冻结</button>

        <button class="layui-btn layui-btn-danger" onclick="openIP()"><i class="layui-icon"></i>添加冻结IP</button>
        <span class="x-right" style="line-height:40px;font-weight:bold">共有数据:{$count}条</span>
      </xblock>
      <table class="layui-table">
               <thead>
                    <tr>
                        <th></th>
                        <th>手机号</th>
                        <th>游戏ID</th>
                        <th>会员昵称</th>
                        <th>冻结时间</th>
                        <th>备注</th>
                        <th>操作人</th>
                    </tr>
                </thead>
                 <tbody>
                    <volist name="lists" id="vo">
                        <tr>
                                <td  style="width: 8px;text-align: center;">
                                     <if condition="$vo.disablelogin eq 0 "> <a href="{:U('freeze/nofree')}?accountid={$vo.accountid}&disablelogin={$vo.disablelogin}&&con_gameid={$con.gameid}&&con_phonenum={$con.phonenum}"><i class="fa fa-unlock text-info" style="font-size: 42px;"></i></a>
                                       <else/><a href="{:U('freeze/free')}?accountid={$vo.accountid}&disablelogin={$vo.disablelogin}&&con_gameid={$con.gameid}&&con_phonenum={$con.phonenum}"><i class="fa fa-lock text-danger" style="font-size: 42px;"></i> </a>
                                       </if>
                                </td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.phonenum}</td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.gameid}</td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.nickname}</td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.disabletime}</td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.content}</td>
                            <td class="contact-type" style="border-left: 1px solid #DDDDDD;color:#3f3f3f;">{$vo.optid}</td>
                        </tr>
                    </volist >
               </tbody>
      </table>
      <div class="page">
            <ul id="example"></ul> 
            <input type="hidden" id="currentPage" value="{$p}">
            <input type="hidden" id="totalPages" value="{$totalPages}">
      </div>
    </div>
    <script>
        function openWinAdd(){
            layer.open({
              type: 2,
              title: '查询冻结玩家',
              shadeClose: true,
              shade: 0.8,
              maxmin: true,
              area: ['1400px', '80%'],
              content: '/freeze/searchOne?type=add' //iframe的url
            }); 
        }

        function openIP(){
            layer.open({
                type: 2,
                title: '冻结IP地址',
                shadeClose: true,
                shade: 0.8,
                maxmin: true,
                area: ['1400px', '80%'],
                content: '/freeze/getip' //iframe的url
            });
        }

        //分页
        $(function(){
            var  currentPage= $("#currentPage").val();   
            var  totalPages= $("#totalPages").val();   
            var options = {
                    bootstrapMajorVersion:3, //对应的bootstrap版本
                    currentPage: currentPage, //当前页数，这里是用的EL表达式，获取从后台传过来的值
                    numberOfPages: 10, //每页页数
                    totalPages:totalPages, //总页数，这里是用的EL表达式，获取从后台传过来的值
                    shouldShowPage:true,//是否显示该按钮
                    itemTexts:function (type, page, current){     
                        switch (type) {
                            case "first":
                                return "首页";
                            case "prev":
                                return "上一页";
                            case "next":
                                return "下一页";
                            case "last":
                                return "末页";
                            case "page":
                                return page;
                        }
                    },
                    //点击事件
                    onPageClicked: function (event, originalEvent, type, page) {
                        var url='/freeze/index.html'; 
                        var str = url+'?p='+page+'&'+ $( "form" ).serialize();
                        window.location.href = str;
                    }
            };
            $('#example').bootstrapPaginator(options);
        });
    </script>
  </body>
</html>-->
